<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      var ge;
      var shi;
      var bai;
      var sum;
// 循环范围
      for (var i = 100; i <= 999; i++) {
        // 获取个十百位数的值
        ge = i % 10;
        shi = parseInt(i / 10) % 10;
        bai = parseInt(i / 100);
        sum = ge * ge * ge + shi * shi * shi + bai * bai * bai;
      //  判断
        if (sum == i) {
          document.write(i);
          document.write("<br/>");
        }
      }
    </script>
  </body>
</html>
